
<?php 
include("../core.php5/DB/ORM.class.php");
include("../core.php5/DB/DataBase.class.php");
include '../core.php5/GUI/Album.class.php';
?>
<html>
<title>
</title>
<head>
		<link rel="stylesheet" href="../jQuery/jquery-ui.css" />
	    <script src="../jQuery/jquery-1.8.3.js"></script>
	    <script src="../jQuery/jquery-ui.js"></script>	
	    		<link href="../css/lightbox.css" rel="stylesheet" />
	    				<script src="../javascript/lightbox.js"></script>
</head>
<body>
<?php 

	isset($_GET['id'])?$album=$_GET['id']:$album=0;
	
	//Obtiene informacion del album
	$ab=Album::getOneAlbum($album);
	
	
	// Obtiene las fotos que contiene el album
	$fotos=array();	
	$fotos=Photo::getPhotos($fotos, $album);
	//print_r($fotos);
	$f=count($fotos);
	$i=1;
	//echo "<br>".$f;
?>
<div id="content2">

					<div class="box">
						<h2><?php echo $ab->description; ?></h2>							
						  <div class="imageRow">
						  	<div class="set">
						  		<?php foreach($fotos as $pic) { 
						  		
						  			$nombre=explode(".", $pic->name);
						  			$class="single";
						  			
						  			if($i==1) $class="single first";
						  			if($i==$f) $class="single last";
						  			
						  			
						  			?>
						  
						      <div class="<?php echo $class;?>">
						  		  <a href="<?php echo "../".$pic->src.$pic->name; ?>" rel="lightbox[<?php echo $ab->description;?>]" title="<?php echo $pic->title; ?>" ><img src="../images/thumbnails/<?php echo $nombre[0];?>_thumb.jpg" alt="<?php echo strtoupper($ab->description); ?>: foto <?php echo $i?> de <?php echo $f; ?> thumb" /></a>
						      </div>
						
						      <?php 
						  		$i++;
						  		} ?>
						  	</div>
						  </div>
								
					</div>
					<a href="javascript:;" onclick="get('select/fotos.php','content');" >Regresar</a>
					<br class="clearfix" />
				</div>
</body>
</html>				
				